<?php


namespace App\Model;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;


class LogPassword  extends Model {
    protected $table = 'log_password';
    protected $primaryKey = 'id';
    protected $dates = [
        'created_at',
        'updated_at',
    ];

    public static function add($old,$new,$ip=""){
            $insert['old_password'] =$old;
            $insert['new_password'] =$new;
            $insert['ip'] =$ip;
            $insert['create_at'] =date("Y-m-d H:i:s",time());
            $insert['update_at'] =date("Y-m-d H:i:s",time());
            return DB::table("log_password")->insertGetId($insert);
    }
}
